package main

import "fmt"

type Student struct {
	Name string
	Age  int
}

//定义方法
func (s Student) test1() {
	fmt.Println(s.Name)
}

//定义函数
func method1(s Student) {
	fmt.Println(s.Name)
}

//定义函数
func method2(s *Student) {
	fmt.Println(s.Name)
}

func main() {
	stu := Student{
		Name: "Tom",
		Age:  18,
	}
	stu.test1()
	method1(stu)
	method2(&stu)
}
